<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddItemToCompaniesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('companies', function (Blueprint $table) {
             $table->integer('order_num')->default(0)->after('role_flag')->comment('账号数量');
             $table->integer('order_created_at')->default(0)->after('order_num')->comment('账号有效起始时间');
             $table->integer('order_updated_at')->default(0)->after('order_created_at')->comment('账号有效截至时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
         Schema::table('companies', function (Blueprint $table) {
            $table->dropColumn(['order_num']);
            $table->dropColumn(['order_created_at']);
            $table->dropColumn(['order_updated_at']);
        });
    }
}
